<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>导出客户数据</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <style>
    body { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; background: #f7fafd; }
    .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 260px; background: linear-gradient(180deg, #1a355b 80%, #1976d2 100%); border-radius: 0 18px 18px 0; box-shadow: 2px 0 8px #e3eaf2; padding: 32px 0; margin: 0; display: flex; flex-direction: column; gap: 0; z-index: 100; }
    .sidebar-title { font-size: 26px; font-weight: bold; color: #fff; letter-spacing: 2px; padding: 0 32px 18px 32px; margin-bottom: 10px; border-bottom: 2px solid #fff2; display: flex; align-items: center; gap: 12px; }
    .sidebar ul { list-style: none; padding: 0; margin: 0; }
    .sidebar li { margin: 0 0 8px 0; }
    .sidebar a, .sidebar .sidebar-btn { display: flex; align-items: center; gap: 12px; font-size: 18px; padding: 14px 32px; border-radius: 16px; background: transparent; color: #fff; border: none; transition: 0.2s; text-decoration: none; text-align: left; cursor: pointer; }
    .sidebar a:hover, .sidebar .sidebar-btn:hover, .sidebar .active { background: #fff; color: #1976d2; font-weight: bold; }
    .sidebar .logout { margin-top: 32px; background: #e3eaf2; color: #1976d2; }
    .sidebar .logout:hover { background: #1976d2; color: #fff; }
    .main-content { margin-left: 260px; flex: 1; display: flex; flex-direction: column; align-items: center; background: #f7fafd; min-width: 350px; max-width: 800px; }
    .card { background: #fff; border-radius: 18px; box-shadow: 0 2px 12px #e3eaf2; padding: 36px 48px 32px 48px; margin: 40px 0 0 0; width: 100%; max-width: 600px; }
    .form-title { color: #1976d2; margin-bottom: 24px; }
    .export-btn { border-radius: 10px; font-size: 18px; background: #1976d2; color: #fff; padding: 12px 36px; border: none; margin-top: 24px; cursor: pointer; }
    .export-btn:hover { background: #145ea8; }
    .export-tip { color: #1976d2; font-size: 16px; margin-bottom: 18px; }
    </style>
</head>
<body>
    <div class="sidebar">
        <div class="sidebar-title"><i class="fa-solid fa-users"></i> 客户管理</div>
        <ul>
            <li><a class="sidebar-btn" href="{{ url_for('customer_add') }}"><i class="fa-solid fa-user-plus"></i> 添加客户</a></li>
            <li><a class="sidebar-btn" href="{{ url_for('customer_list') }}"><i class="fa-solid fa-list"></i> 客户列表</a></li>
            <li><a class="sidebar-btn" href="{{ url_for('customer_update') }}"><i class="fa-solid fa-pen"></i> 更新客户</a></li>
            <li><a class="sidebar-btn" href="{{ url_for('customer_delete') }}"><i class="fa-solid fa-user-minus"></i> 删除客户</a></li>
            <li><a class="sidebar-btn" href="{{ url_for('customer_export') }}"><i class="fa-solid fa-download"></i> 导出客户数据</a></li>
            <li><a class="sidebar-btn" href="{{ url_for('customer_query') }}"><i class="fa-solid fa-search"></i> 客户查询</a></li>
        </ul>
        <a href="/admin_menu" class="sidebar-btn logout"><i class="fa-solid fa-arrow-left"></i> 返回管理员菜单</a>
    </div>
    <div class="main-content">
        <div class="card">
            <h2 class="form-title"><i class="fa-solid fa-download"></i> 导出客户数据</h2>
            <div class="export-tip">点击下方按钮可导出所有客户数据为CSV文件。</div>
            {% with messages = get_flashed_messages(with_categories=true) %}
              {% if messages %}
                {% for category, message in messages %}
                  <div class="flash {{ category }}">{{ message }}</div>
                {% endfor %}
              {% endif %}
            {% endwith %}
            <form method="get" action="/customer_export">
                <button type="submit" class="export-btn"><i class="fa-solid fa-download"></i> 导出客户数据</button>
            </form>
        </div>
    </div>
</body>
</html> 